package com.goldcn.enumeration;

import com.google.common.base.Objects;

import java.math.BigDecimal;

/**
 * Created by Administrator on 2017/9/20.
 */
public enum PayFeeEnum {
    wechatApp(1,BigDecimal.valueOf(6)),
    ccb(2,BigDecimal.valueOf(2.5)),
    alipay(3,BigDecimal.valueOf(0)),
    wechatJs(4,BigDecimal.valueOf(6)),
    ccbApp(5,BigDecimal.valueOf(2.5)),
    zeroPay(6,BigDecimal.valueOf(0)),
    defalutPay(99,BigDecimal.valueOf(0));

    private Integer payType;//支付方式
    private BigDecimal thousand;//千分比

    /**
     *
     * @param payType 1微信app支付 2建行支付 3支付宝 4 微信js支付 6.零支付
     * @param thousand
     */
    PayFeeEnum(Integer payType, BigDecimal thousand) {
        this.payType = payType;
        this.thousand = thousand;
    }

    public static PayFeeEnum valuekOf(Integer payType) {
        for (PayFeeEnum payFeeEnum : values()) {
            if (Objects.equal(payType,payFeeEnum.getPayType())) {
                return payFeeEnum;
            }
        }
        return defalutPay;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public BigDecimal getThousand() {
        return thousand;
    }

    public void setThousand(BigDecimal thousand) {
        this.thousand = thousand;
    }
}
